﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UniMana.Utils.Controls;
namespace UniMana.Data
{
    public class Log_AddStudentSubjectClassInfo
    {
            #region /*Không thay đổi*/
            public bds m_bds = new bds();
            public void Save()
            {
                m_bds.EndEdit();
                m_data.m_DCSave.SubmitChanges();
            }
            public void Delete()
            {
                m_bds.DeleteCurrent();
            }
            #endregion /*Không thay đổi*/
            private DBMain m_data = new DBMain();
            #region [Properties - Thuộc tính]
       
            public Log_AddStudentSubjectClass Properties
            {
                get { return m_bds.Current as Log_AddStudentSubjectClass; }
            }
            #endregion
            public Log_AddStudentSubjectClassInfo(int _iLog_AddStudentSubjectClassInfo=-1)
            {
                var IQuery = m_data.m_DCSave.Log_AddStudentSubjectClasses.Where(t => t.Log_AddStudentSubjectClassKey == _iLog_AddStudentSubjectClassInfo);
                m_bds.DataSource = IQuery;
                var Row = IQuery.FirstOrDefault();
                if (Row == null)
                {

                    Row = new Log_AddStudentSubjectClass();
                    m_bds.Add(Row);
                }
            }
    }
}
